/**
 * @Description 删除字符串中的所有空格
 * @Author hhy
 * @Date 2020/10/6 19:09
 */
public class RemoveAllSpace {
    public static void main(String[] args) {
        String a = "1 1 1";
        System.out.println(trimAll(a));
    }

    public static String trimAll(String str){
         str = str.trim();
        String newString = "";
        for (int i = 0; i < str.length(); i++) {
            if (str.charAt(i)+0!=32){
                newString += str.charAt(i);
            }
        }
        return newString;
    }
}
